@layout("/common/_vContainer.html"){
<el-row id="app">
    <el-row :gutter="20">
        <el-col :span="6">
            <div class="card">
                <div class="p-tb-10 f-w-700">成绩关联挖掘</div>
            </div>
        </el-col>
        <el-col :span="18">
            <div class="card">
                <el-button type="success" v-on:click="location.reload()"><i class="el-icon-refresh"></i> 刷新</el-button>
            </div>
        </el-col>
    </el-row>

    <div class="card" v-loading.sync="loading" element-loading-text="正在进行离散计算并生成属性文件...">
        <div>选择年级-班级</div>
        <el-row :gutter="20" class="m-t-20">
            <el-form :inline="true">
                <el-form-item label="选择年级">
                    <el-select placeholder="选择年级" v-model="condition.term">
                        <el-option value="2014" label="2014年"></el-option>
                        <el-option value="2015" label="2015年"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="开始学期">
                    <el-select placeholder="选择学期阶段" v-model="condition.xueqi1">
                        <el-option value="1" label="第1学期"></el-option>
                        <el-option value="2" label="第2学期"></el-option>
                        <el-option value="3" label="第3学期"></el-option>
                        <el-option value="4" label="第4学期"></el-option>
                        <el-option value="5" label="第5学期"></el-option>
                        <el-option value="6" label="第6学期"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="结束学期">
                    <el-select placeholder="选择学期阶段" v-model="condition.xueqi2">
                        <el-option value="1" label="第1学期"></el-option>
                        <el-option value="2" label="第2学期"></el-option>
                        <el-option value="3" label="第3学期"></el-option>
                        <el-option value="4" label="第4学期"></el-option>
                        <el-option value="5" label="第5学期"></el-option>
                        <el-option value="6" label="第6学期"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="选择专业">
                    <el-select placeholder="选择专业" v-model="condition.major">
                        <el-option value="RJ" label="学前教育"></el-option>
                        <el-option value="SJ" label="软件工程"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="选择科目类型">
                    <el-select placeholder="选择科目类型" multiple v-model="condition.subjectType">
                        <!--<el-option value="qb" label="全部"></el-option>-->
                        <el-option value="bx" label="必修课"></el-option>
                        <el-option value="xs" label="选修课"></el-option>
                        <el-option value="fz" label="发展能力"></el-option>
                        <el-option value="sz" label="素质成绩"></el-option>
                    </el-select>
                </el-form-item>
            </el-form>
        </el-row>
    </div>
    <div class="card" v-loading.sync="loading" element-loading-text="正在进行离散计算并生成属性文件...">
        <el-row :gutter="40" class="m-t-20">
            <el-col :span="20">
                <div>
                    <span>自定义离散分组</span>
                    <el-button type="primary" size="mini" v-on:click="addRule">新增分组</el-button>
                </div>
                <el-form :model="condition" :inline="true" class="m-t-20">
                    <el-form-item v-for="(rule,$index) in rules" :label="'分组'+($index+1)">
                        <el-input placeholder="如60-70" v-model="rules[$index].value">
                            <el-select v-model="rules[$index].key" slot="prepend" :placeholder="'离散等级'+($index+1)" style="width: 120px;">
                                <el-option v-for="item in level" :label="item" :value="item"></el-option>
                            </el-select>
                            <el-tooltip slot="append" placement="top" content="删除分组">
                                <el-button icon="el-icon-delete" v-on:click="rules.splice($index,1)" :disabled="$index==0"></el-button>
                            </el-tooltip>
                        </el-input>
                    </el-form-item>
                </el-form>
            </el-col>
            <el-col :span="4">
                <div>分组预览</div>
                <div v-for="(item,$index) in rules" class="m-t-20">
                    <el-tag type="success" size="mini" v-text="$index+1"></el-tag>
                    <span v-text="(item.key||'等级')+' : '"></span>
                    <span v-text="item.value||'分数段'"></span>
                </div>
            </el-col>
        </el-row>
    </div>

    <el-row :gutter="20">
        <el-col :span="12">
            <!--优化方案-->
            <div class="card">
                <h3>优化算法方案</h3>
                <div class="m-t-20">
                    <el-form :inline="true">
                        <el-form-item label="单科目项目阀值">
                            <el-input v-model="condition.minRangeNum"></el-input>
                        </el-form-item>
                    </el-form>
                </div>
                <el-row class="m-t-10">
                    <el-button type="primary" v-on:click="genFile()" :loading="loading">生成ARFF文件</el-button>
                </el-row>
                <!--已经生成了ARFF文件-->
                <div class="animated fadeIn" v-show="filePath">
                    <h3>预览ARFF属性文件</h3>
                    <el-row>
                        <div>
                            <span>ARFF文件预览: &nbsp;</span>
                            <span v-text="filePath"></span>
                        </div>
                        <div class="m-t-20">
                            <el-button type="" v-on:click="view">预览ARFF文件</el-button>
                            <el-button type="warning" v-show="modal4view" v-on:click="modal4view=false">关闭预览</el-button>
                        </div>
                        <div class="m-t-20" v-show="modal4view">
                            <el-row style="max-height: 500px;overflow: auto;">
                                <div v-for="(item,$index) in fileData" v-text="item"></div>
                            </el-row>
                        </div>
                    </el-row>
                </div>

                <!--设定阀值-->
                <div class="animated fadeIn" v-show="filePath">
                    <h3>设定阀值，计算关联关系</h3>
                    <el-row>
                        <el-form :inline="true">
                            <el-form-item label="最小支持度下限">
                                <el-input v-model="digModel.minSupport"></el-input>
                            </el-form-item>
                            <el-form-item label="最小支持度上限">
                                <el-input v-model="digModel.maxSupport"></el-input>
                            </el-form-item>
                            <el-form-item label="优化算法支持度峰值">
                                <el-input v-model="digModel.peakValue"></el-input>
                            </el-form-item>
                            <el-form-item label="最小置信度">
                                <el-input v-model="digModel.minMetric"></el-input>
                            </el-form-item>
                            <el-form-item label="支持度增量">
                                <el-input v-model="digModel.delta"></el-input>
                            </el-form-item>
                            <el-form-item label="结果关联规则条数">
                                <el-input v-model="digModel.resultNum"></el-input>
                            </el-form-item>
                        </el-form>
                    </el-row>
                    <div class="m-t-10">
                        <el-button type="warning" :loading="loading4dig" v-on:click="digData()">点击开始计算关联关系</el-button>
                        <el-button type="success" :loading="loading4dig" v-on:click="saveData()" v-if="digResult" :loading="loading4save"><i class="el-icon-tickets"></i> 保存关联规则结果</el-button>
                    </div>
                    <div class="m-t-20" v-loading="loading4dig">
                        <h3>算法整体耗时：{{digResultTime}} ms</h3>
                        <h3>Lift数值：{{count4lift}} 条记录</h3>
                        <div class="jumbotron">
                            <p v-html="digResult"></p>
                        </div>
                    </div>
                </div>
            </div>
        </el-col>

        <!--原算法方案-->
        <el-col :span="12">
            <div class="card">
                <h3>原算法方案</h3>
                <div class="m-t-20">
                    <el-form :inline="true">
                        <el-form-item label="单科目项目阀值">
                            <el-input disabled :value="1"></el-input>
                        </el-form-item>
                    </el-form>
                </div>
                <el-row class="m-t-10">
                    <el-button type="primary" v-on:click="genFile2()" :loading="loading">生成ARFF文件</el-button>
                </el-row>
                <!--已经生成了ARFF文件-->
                <div class="animated fadeIn" v-show="filePath2">
                    <h3>预览ARFF属性文件</h3>
                    <el-row>
                        <div>
                            <span>ARFF文件预览: &nbsp;</span>
                            <span v-text="filePath2"></span>
                        </div>
                        <div class="m-t-20">
                            <el-button type="" v-on:click="view2">预览ARFF文件</el-button>
                            <el-button type="warning" v-show="modal4view2" v-on:click="modal4view2=false">关闭预览</el-button>
                        </div>
                        <div class="m-t-20" v-show="modal4view2">
                            <el-row style="max-height: 500px;overflow: auto;">
                                <div v-for="(item,$index) in fileData2" v-text="item"></div>
                            </el-row>
                        </div>
                    </el-row>
                </div>

                <!--设定阀值-->
                <div class="animated fadeIn" v-show="filePath2">
                    <h3>设定阀值，计算关联关系</h3>
                    <el-row>
                        <el-form :inline="true">
                            <el-form-item label="最小支持度下限">
                                <el-input v-model="digModel.minSupport"></el-input>
                            </el-form-item>
                            <el-form-item label="最小支持度上限">
                                <el-input v-model="digModel.maxSupport"></el-input>
                            </el-form-item>
                            <el-form-item label="最小置信度">
                                <el-input v-model="digModel.minMetric"></el-input>
                            </el-form-item>
                            <el-form-item label="支持度增量">
                                <el-input v-model="digModel.delta"></el-input>
                            </el-form-item>
                            <el-form-item label="结果关联规则条数">
                                <el-input v-model="digModel.resultNum"></el-input>
                            </el-form-item>
                            <!--<el-form-item label="单科目项目阀值">-->
                            <!--<el-input v-model="digModel.subjectValue"></el-input>-->
                            <!--</el-form-item>-->
                        </el-form>
                    </el-row>
                    <div class="m-t-10">
                        <el-button type="warning" :loading="loading4dig" v-on:click="digData2()">点击开始计算关联关系</el-button>
                    </div>
                    <div class="m-t-20" v-loading="loading4dig">
                        <h3>算法整体耗时：{{digResultTime2}} ms</h3>
                        <h3>Lift数值：{{count4lift2}} 条记录</h3>
                        <div class="jumbotron">
                            <p v-html="digResult2"></p>
                        </div>
                    </div>
                </div>
            </div>
        </el-col>
    </el-row>

    <!--展示数据挖掘结果-->
    <div class="card animated fadeIn" v-show="showResult2">

    </div>

    <!--view file modal-->
    <!--<el-dialog :visible.sync="false" width="80%" :modal-append-to-body="false" title="ARFF属性文件预览">-->
        <!--<el-row style="max-height: 500px;overflow: auto;">-->
            <!--<div v-for="(item,$index) in fileData" v-text="item"></div>-->
        <!--</el-row>-->
        <!--<div slot="footer" class="text-right">-->
            <!--<el-button v-on:click="modal4view = false">关闭预览</el-button>-->
        <!--</div>-->
    <!--</el-dialog>-->

</el-row>
<script src="${ctxPath}/static/modular/edu/cal/cal.js"></script>
@}
